/*
 * Ex28.h
 *
 *  Created on: Oct 11, 2013
 *      Author: Administrator
 */

#ifndef EX28_H_
#define EX28_H_

class Ex28 {
public:
	Ex28();
	virtual ~Ex28();
};

class Apple;
class Orange;

class Apple{
	int type;
	int name;
public:
	Apple(int a):name(a){
		type = 1;
	}
	friend class Orange;

};

class Orange{
	int type;
	int name;
public:
	Orange(int a):name(a){
		type = 2;
	}
	explicit Orange(Apple& a):name(a.name){
		type =2 ;
	}
	operator Apple(){
		return Apple(*this);
	}

};
#endif /* EX28_H_ */
